package com.gulimall.member.controller;


import com.gulimall.common.core.domain.Result;
import com.gulimall.member.domain.entity.MemberReceiveAddress;
import com.gulimall.member.service.IMemberReceiveAddressService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 会员收货地址 前端控制器
 * </p>
 *
 * @author 坤哥
 * @since 2025-08-27
 */
@Slf4j
@RestController
@RequestMapping("/member-receive-address")
public class MemberReceiveAddressController {
    @Resource
    private IMemberReceiveAddressService memberReceiveAddressService;

    /**
     * 获取用户的收货地址列表
     * ums_member_receive_address表
     */
    @GetMapping("/getMemberReceiveAddress/{memberId}")
    public Result<List<MemberReceiveAddress>> getMemberReceiveAddress(@PathVariable("memberId") Long memberId){
        log.info("获取{}用户的收货地址列表：",memberId);
        List<MemberReceiveAddress> memberReceiveAddressList = memberReceiveAddressService.getMemberReceiveAddress(memberId);
        return Result.ok(memberReceiveAddressList);
    }
}
